package cn.edu.sctu.sctu_lysd.view.act;

import android.content.Context;
import android.os.Bundle;
import android.view.View;

import com.squareup.picasso.Picasso;

import cn.edu.sctu.sctu_lysd.R;
import cn.edu.sctu.sctu_lysd.base.BaseActivity;
import cn.edu.sctu.sctu_lysd.databinding.ActivityShowImgBinding;
import cn.edu.sctu.sctu_lysd.utils.JumpUtils;

/**
 * Created by wangfuxin on 2017-04-21.
 */

public class ShowImgAct extends BaseActivity {
    private ActivityShowImgBinding mBinding;
    private static final String INTENT_IMG_PATH_TAG = "imgPath";

    @Override
    protected int getLayoutResource() {
        return R.layout.activity_show_img;
    }

    public static void intentThis(Context context,String imgPath) {

        Bundle bundle = new Bundle();
        bundle.putString(INTENT_IMG_PATH_TAG, imgPath);
        JumpUtils.jumpActivity(context, ShowImgAct.class, bundle);
    }

    @Override
    protected void initAfter(Object bind) {

        mBinding = (ActivityShowImgBinding) bind;

        Picasso.with(this)
                .load(getIntent().getExtras().getString(INTENT_IMG_PATH_TAG))
                .into(mBinding.img);

        mBinding.img.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

    }
}
